<script setup lang="ts">
import SonComp from './components/SonComp.vue'
import { ref } from 'vue'

const car = ref('宝马')
</script>

<template>
  <div>
    <h1>v-model - {{ car }}</h1>
    <!-- 直接在父组件中用v-model=xxx，在子组件中接收的字段是modelVlaue -->
    <son-comp v-model="car"></son-comp>

    <son-comp :model-value="car" @update:model-value="car = $event"></son-comp>
  </div>
</template>

<style scoped lang="scss"></style>
